package simulator;
import java.awt.*;
import java.awt.geom.*;
/**
 * Serves as a barrier in simulated mazes
 * @author anand
 *
 */
public class Wall extends PhysicalObject {
  private double width;
  private double height;

  public Wall(double x, double y, double width, double height) {
    this.x=x;
    this.y=y;
    this.width=width;
    this.height=height;
  }

  public boolean intersects(double x, double y) {
    return (new Rectangle2D.Double(this.x, this.y, width, height).contains(x, y));
  }

  public void paint(Graphics g){
    g.setColor(Color.BLACK);
    g.drawRect((int) x, (int) y, (int) width, (int) height);
    g.setColor(Color.GRAY);
    g.fillRect((int)x, (int)y, (int)width, (int)height);
  }

  public double getWidth(){
    return width;
  }

  public double getHeight(){
    return height;
  }

  public void setWidth(double newb) {
    width=newb;
  }

  public void setHeight(double newb) {
    height=newb;
  }
}
